<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>设备列表</title>
		<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/list.css"/>
	</head>
	<body>
		<!-- 蓝色背景区域 -->
		<div class="wrap">
			<!-- 白色可用区域 -->
			<div class="canuse">
				<!------ 位置 ------>
	            <p class="contentText local"><span>位置：设备管理</span></p>
	            
            	<!-- 搜索区 -->
	            <div class="search_area">
                    <h4 class="sel_title"><img src="../../img/list/brand1.png" /><span>设备查询条件</span></h4>
                    <div class="select_area">
                        <div class="select_text clear">
                        	<div class="label_input">
	                            <label class="contentText">设备名称：</label> <input type="text" name="" id="">
                        	</div>
							<div class="label_input">
	                            <label class="contentText">仓库：</label> <input type="text" name="" id="">
                        	</div>
                            <div class="floatLeft">
	                            <button class="btn_search bgd_blue_search">查询</button>
	                            <button class="btn_clear bgd_white_clear">重置</button>
                            </div>
                        </div>
                    </div>
	            </div>
	            
	            <!-- 列表区 -->
	            <div class="show_list">
                	<div class="title_operate">
                    	<h4 class="sel_title"><img src="../../img/list/brand1.png" /><span>设备列表</span></h4>
                		
                        <!-- 操作类型区 -->
                        <div class="operate_area">
                            <a href="deviceAdd.html" class="bgd_add img_hand">增加</a> 
                            <a onclick="delUserGroup();" class="bgd_delete img_hand">删除</a> 
                        </div>
                	</div>
                	<div class="list_area">
                        <!-- 信息列表区 -->
                        <div class="info_area">
                            <table class="tablelist" border="1" cellspacing="0" cellpadding="0">
                                <tbody>
                                    <tr class="menuText list_head">
                                        <th class="checkSelectAll"></th>
                                        <th class="">序号</th>
                                        <th class="">设备名称</th>
                                        <th class="">仓库</th>
                                        <th class="">出入库类型</th>
                                        <th class="">IP地址</th>
                                        <th class="">端口号</th>
                                    </tr>
                                </tbody>
                                <tbody class="tablelist">
                                    <tr class="listTableText list_list">
                                        <td><input type="checkbox" class="input_checkBox" name="ids" id="" value=""></td>
                                        <td>1</td>
                                        <td><a class="cursor" href="deviceUpdate.html">无人机</a></td>
                                        <td>ck01</td>
										<td>入库</td>
                                        <td>192.168.16.101</td>
										<td>8080</td>
                                    </tr>
                                    <tr class="listTableText list_list">
                                        <td><input type="checkbox" class="input_checkBox" name="ids" id="" value=""></td>
                                        <td>2</td>
                                        <td><a class="cursor" href="deviceUpdate.html">无人机</a></td>
                                        <td>ck01</td>
										<td>入库</td>
                                        <td>192.168.16.102</td>
										<td>8081</td>
                                    </tr>
                                    <tr class="listTableText list_list">
                                        <td><input type="checkbox" class="input_checkBox" name="ids" id="" value=""></td>
                                        <td>3</td>
                                        <td><a class="cursor" href="deviceUpdate.html">无人机</a></td>
                                        <td>ck02</td>
										<td>出库</td>
                                        <td>192.168.16.103</td>
										<td>8088</td>
                                    </tr>
                                    <tr class="listTableText list_list">
                                        <td><input type="checkbox" class="input_checkBox" name="" id="" value=""></td>
                                        <td>4</td>
                                        <td><a class="cursor" href="deviceUpdate.html">无人机</a></td>
                                        <td>ck02</td>
										<td>出库</td>
                                        <td>192.168.16.105</td>
										<td>8085</td>
                                    </tr>
                                    <tr class="listTableText list_list">
                                        <td><input type="checkbox" class="input_checkBox" name="ids" id="" value=""></td>
                                        <td>5</td>
                                        <td><a class="cursor" href="deviceUpdate.html">无人机</a></td>
                                        <td>ck07</td>
										<td>入库</td>
                                        <td>192.168.16.107</td>
										<td>8087</td>
                                    </tr>
                                    <tr class="listTableText list_list">
                                        <td><input type="checkbox" class="input_checkBox" name="ids" id="" value=""></td>
                                        <td>6</td>
                                        <td><a class="cursor" href="deviceUpdate.html">无人机</a></td>
                                        <td>ck06</td>
										<td>出库</td>
                                        <td>192.168.16.106</td>
										<td>8086</td>
                                    </tr>
                                    <tr class="listTableText list_list">
                                        <td><input type="checkbox" class="input_checkBox" name="ids" id="" value=""></td>
                                        <td>7</td>
                                        <td><a class="cursor" href="deviceUpdate.html">无人机</a></td>
                                        <td>ck08</td>
										<td>入库</td>
                                        <td>192.168.16.108</td>
										<td>8089</td>
                                    </tr>
                                    <tr class="listTableText list_list">
                                        <td><input type="checkbox" class="input_checkBox" name="ids" id="" value=""></td>
                                        <td>8</td>
                                        <td><a class="cursor" href="deviceUpdate.html">无人机</a></td>
                                        <td>ck01</td>
										<td>出库</td>
                                        <td>192.168.16.111</td>
										<td>8090</td>
                                    </tr>
                                    <tr class="listTableText list_list">
                                        <td><input type="checkbox" class="input_checkBox" name="ids" id="" value=""></td>
                                        <td>9</td>
                                        <td><a class="cursor" href="deviceUpdate.html">无人机</a></td>
                                        <td>ck21</td>
										<td>入库</td>
                                        <td>192.168.16.121</td>
										<td>8080</td>
                                    </tr>
                                    <tr class="listTableText list_list">
                                        <td><input type="checkbox" class="input_checkBox" name="ids" id="" value=""></td>
                                        <td>10</td>
                                        <td><a class="cursor" href="deviceUpdate.html">无人机</a></td>
                                        <td>ck11</td>
										<td>入库</td>
                                        <td>192.168.16.131</td>
										<td>8098</td>
                                    </tr>
                                </tbody>

                            </table>
                        </div>
	                    <!-- 页码区域 -->
	                    <div class="page_area contentText clear">
	                    	<div class="page_sum">
	                    		共<span class="page_number"> 3 </span>页&emsp;每页 10 条&emsp;共<span class="info_sum"> 27 </span>条记录
	                    	</div>
	                        <div class="page-pull-right async-page">
	                            <button>首页</button>
	                            <button>&lt;&lt;</button>
	                            <button class="select_page">1</button>
	                            <button>2</button>
	                            <button>3</button>
	                            <button>&gt;&gt;</button>
	                            <button>尾页</button>
	                        </div>
	                    </div>
                    </div>
                </div>
			</div>
			
			<!-- 版尾  -->
			<div class="ending">
				Copyright© 2019-2020 磐基技术有限公司
			</div>
			
			<!-- 等待加载 -->
			<!--<div class="loader"><p class="load_hint">请等待加载••••••</p></div>-->
			
		</div>
	</body>
	<script src="../../js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/frame/common.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		var h = document.documentElement.clientHeight;
		$(".wrap").css("height", h);
		
		// 获取每行 td 的兄弟节点
		$("td").hover(   
			function () {      
				$(this).parent().children().addClass("td_hover");   
			},    
			function () {      
				$(this).parent().children().removeClass("td_hover");   
			}
		);
		
		
		//删除规则
	    function delUserGroup() {
			
	        var list = [];
	        var checks = $("input[name='ids']:checked");
	        $.each(checks, function(index, obj) {
	            list.push(obj.id);
	        });
	        if (!list.length > 0) {
	            alert("请选择要删除的内容");
	            return;
	        }
	        if (!confirm("确定要删除所选记录吗？")) {
				var node = $("input[name='ids']:checked").parents(".list_list");
				node.hide();
	            return;
	        }
	        alert("提醒:删除时，正在使用的用户组将无法删除！");
	        $.ajax({
	            type : 'POST',
	            url : 'userGroup/delUserGroup',
	            data : JSON.stringify(list),
	            contentType : 'application/json; charset=utf-8',
	            async : true,
	            cache : false,
	            success : function(data) {
	                alert(data == 'success' ? "删除成功" : "被使用：无法删除!!!");
	                if (data != 'success') {
	                    return;
	                }
	
	                var current = PageUtils._currentPage['userGroupPage'];
	                PageUtils.pageClick(current, 'userGroupPage');
	            }
	
	        });
	    }
	</script>
</html>
